feat(worksheet): port worksheet CRUD from Go CLI#15
Draft
beengud wants to merge 1 commit into
Draft
Conversation
Add `observe worksheet` with list/get/create/delete subcommands,
mirroring the deprecated Go CLI. Operations are validated against the
published Observe GraphQL SDL.
- list: worksheetSearch with --name (case-insensitive substring) and
--workspace; supports --format json|csv (table by default)
- get <id>: worksheet(id) including stages { id pipeline }
- create <file.json>: saveWorksheet(wks: WorksheetInput); strips
read-only updatedDate; requires name, workspaceId, stages
- delete <id>: deleteWorksheet -> ResultStatus, prints confirmation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7
Ported surface
observe worksheet(list / get / create / delete), mirroring the deprecated Go CLI (cmd_worksheet.go,ot_worksheet.go). All operations validated against the published Observe GraphQL SDL.worksheet list [--name <filter>] [--workspace <id>] [--format json|csv]—worksheetSearch(terms: DWSearchInput!). PassesworkspaceId/nameinto search terms (both list-typed in the SDL), then applies a case-insensitive substring filter client-side. Tabular by default; supports--format json|csv.worksheet get <id> [--format json]—worksheet(id: ObjectId!), JSON output includingstages { id pipeline }.worksheet create <file.json> [--workspace <id>]—saveWorksheet(wks: WorksheetInput!). Reads a JSONWorksheetInput, strips read-onlyupdatedDate, requiresname/workspaceId/stages;--workspaceoverrides the file'sworkspaceId.worksheet delete <id>—deleteWorksheet(wks: ObjectId!)→ResultStatus; prints a confirmation message and fails onsuccess: false.Registered in
src/app.ts(abovecli), documented in README Commands table and AGENTS.md Project Structure.Field-name corrections vs initial guess (from the Go source)
The old Go CLI's hand-written queries disagreed with the published SDL; corrected to match the SDL:
worksheetSearch { results { worksheet ... } }. SDL isWorksheetSearchResultWrapper { worksheets: [WorksheetSearchResult!]! }— corrected toworksheets.DWSearchInput.workspaceId: [ObjectId!]andname: [String!]— pass arrays, not scalars.id, notstageID:StageQuery/StageQueryInputexposeid(mapped fromStageID). The Gogetquery selectedstages { stageID pipeline }, which would not validate — corrected tostages { id pipeline }. (Matches the brief's warning.)deleteWorksheetreturnsResultStatus { success errorMessage }(Go assumed the same shape; confirmed againstbase_public.graphql).Verification
src/gql/worksheet/**, schema = published TF-provider SDL):✔ Generate— all four operations validate against the SDL.tsc --noEmitoversrc/commands/worksheet,src/gql/worksheet,src/lib,src/context.ts): no errors in worksheet sources. Remaining diagnostics are confined to*.test.tsand are only the expectedbun:test/import.metanoise.bun test src/commands/worksheet/→ 13 pass, 0 fail (4 files; list/get/create/delete).🤖 Generated with Claude Code